package com.blue.wechat.receive.model;

import java.util.Date;

import com.blue.core.dict.WechatRequestType;

/**
 * 微信请求信息基类
 * 
 * @author zhengj
 * @since 2016年5月26日 1.0
 */
public abstract class AbstractRequest
{
	private String toUserName;
	private String fromUserName;
	private Date createTime;
	private WechatRequestType type;
	private Long msgId;

	// 匹配数据库字段
	private Integer wechatId;
	private String wechatCode;
	private Integer userId;
	private Long id;

	public AbstractRequest()
	{
	}

	/**
	 * 设置请求报文类型
	 * 
	 * @param type 报文文本类型
	 */
	public void setStrType(String type)
	{
		this.type = WechatRequestType.getType(type);
	}

	/**
	 * 设置请求报文类型
	 * 
	 * @param type 报文数字类型
	 */
	public void setIntType(int type)
	{
		this.type = WechatRequestType.getIndex(type);
	}

	public String getToUserName()
	{
		return toUserName;
	}

	public void setToUserName(String toUserName)
	{
		this.toUserName = toUserName;
	}

	public String getFromUserName()
	{
		return fromUserName;
	}

	public void setFromUserName(String fromUserName)
	{
		this.fromUserName = fromUserName;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public WechatRequestType getType()
	{
		return type;
	}

	public void setType(WechatRequestType type)
	{
		this.type = type;
	}

	public Long getMsgId()
	{
		return msgId;
	}

	public void setMsgId(Long msgId)
	{
		this.msgId = msgId;
	}

	public Integer getWechatId()
	{
		return wechatId;
	}

	public void setWechatId(Integer wechatId)
	{
		this.wechatId = wechatId;
	}

	public String getWechatCode()
	{
		return wechatCode;
	}

	public void setWechatCode(String wechatCode)
	{
		this.wechatCode = wechatCode;
	}

	public Integer getUserId()
	{
		return userId;
	}

	public void setUserId(Integer userId)
	{
		this.userId = userId;
	}

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

}
